import request from "@/utils/request";

// 查询来料检验单列表
export function listIqc(query) {
  return request({
    url: "/mes/qc/iqc/list",
    method: "get",
    params: query,
  });
}
export function listIqcHead(data) {
  return request({
    url: "/mes/qc/iqcHead/list",
    method: "post",
    data: data,
  });
}

// 查询来料检验单详细
export function getIqc(iqcId) {
  return request({
    url: "/mes/qc/iqc/" + iqcId,
    method: "get",
  });
}

// 新增来料检验单
export function addIqc(data) {
  return request({
    url: "/mes/qc/iqc",
    method: "post",
    data: data,
  });
}

// 根据收料通知单新增来料检验单
export function addQcIqc(data) {
  return request({
    url: "/mes/qc/iqc/addQcIqc",
    method: "post",
    data: data,
  });
}

// 修改来料检验单
export function updateIqc(data) {
  return request({
    url: "/mes/qc/iqc",
    method: "put",
    data: data,
  });
}

// 删除来料检验单
export function delIqc(iqcId) {
  return request({
    url: "/mes/qc/iqc/" + iqcId,
    method: "delete",
  });
}

// 查询检查项检查内容等
export function getinspectData(data) {
  return request({
    url: "/mes/qc/iqc/iqcInspect",
    method: "post",
    data: data,
  });
}

// 检验页面的提交接口
export function submitQcIqc(data) {
  return request({
    url: "/mes/qc/iqc/submitInspect",
    method: "post",
    data: data,
  });
}

//详情接口
export function getDetail(data) {
  return request({
    url: "/mes/qc/iqc/checkInspect",
    method: "post",
    data: data,
  });
}

// 下载详情接口
export function exportIqcInfo(data) {
  return request({
    url: "/mes/qc/iqc/export/iqcInfo",
    method: "post",
    data: data,
    responseType: "blob",
  });
}

// 修改iqc检验
export function editQcIqcInfoDto(data) {
  return request({
    url: "/mes/qc/iqcHead/editQcIqcInfoDto",
    method: "put",
    data: data,
  });
}

// 调整 iqc 检验
export function mentQcIqcInfoDto(data) {
  return request({
    url: "/mes/qc/iqc/adjustInspect",
    method: "post",
    data: data,
  });
}

// 下推
export function pushDownQcIqcInfoDto(data) {
  return request({
    url: "/mes/qc/iqcHead/pushDownQcIqcInfoDto",
    method: "put",
    data: data,
  });
}

// 撤回
export function revocationQcIqc(data) {
  return request({
    url: "/mes/qc/iqcHead/revocation",
    method: "put",
    data: data,
  });
}

// 查询质检方案list
export function qcschemeAll() {
  return request({
    url: "/mes/qc/qcscheme/all",
    method: "get",
  });
}

//根据id查询质检方案
export function qcscheme(data) {
  return request({
    url: "/mes/qc/iqc/qryIqcInspect",
    method: "post",
    data: data,
  });
}

// 获取序列号打印参数
export function getSnCode(data) {
  return request({
    url: "/mes/qc/iqcHead/getPrintParam/getSnCode",
    method: "post",
    data: data,
  });
}

// 获取批次号打印参数
export function getBanthNo(data) {
  return request({
    url: "/mes/qc/iqcHead/getPrintParam/getBanthNo",
    method: "post",
    data: data,
  });
}

// iqc列表导出
export function handleExport(data) {
  return request({
    url: "/mes/qc/iqcHead/export",
    method: "post",
    data: data,
  });
}

//批量删除
export function handleDeleteList(data) {
  return request({
    url: "/mes/qc/iqcHead/delete",
    method: "post",
    data: data,
  });
}

//2024-12-26 djj 新增 复核弹框 查询接口
export function iqcInspectQE(data) {
  return request({
    url: "/mes/qc/iqc/iqcInspectQE",
    method: "post",
    data: data,
  });
}

// 2024-12-26 djj 新增 复验页面的提交接口
export function submitQEInspect(data) {
  return request({
    url: "/mes/qc/iqc/submitQEInspect",
    method: "post",
    data: data,
  });
}

//2024-12-26 djj 新增 复核详情 接口
export function queryLineList(query) {
  return request({
    url: "/mes/back/approveline/queryLineList",
    method: "get",
    params: query,
  });
}
/* 2024-12-29 djj 新增 驳回 接口 */
export function iqcReject(data) {
  return request({
    url: "/mes/qc/iqc/iqcReject",
    method: "post",
    data: data,
  });
}

/* 2025-2-12  djj 新增 异常提报 接口 */
export function submitExceptionRecord(data) {
  return request({
    url: "/mes/qc/iqc/submitExceptionRecord",
    method: "post",
    data: data,
  });
}